package com.example.mydemoapp

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.EditText
import com.example.news.NewsDashboardActivity

const val EXTRA_MESSAGE = "com.example.mydemoapp.MESSAGE"

class DemoMainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_demo_main)
    }

    fun sendMessage(view: View) {
        val editText = findViewById<EditText>(R.id.editText)
        val message = editText.text.toString()
        val intent = Intent(this,DisplayMessageActivity::class.java).apply {
            putExtra(EXTRA_MESSAGE,message)
        }
        startActivity(intent)
    }

    fun news(view: View){

        val intent = Intent(this,NewsDashboardActivity::class.java).apply {

        }
        startActivity(intent)
    }

    fun liveData(view: View){

    }
}